package com.tian.controller;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.request;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tian.po.Doctor;
import com.tian.service.doctorService;

@Controller
@RequestMapping("/doctor")
public class doctorController {
	@Autowired
	private doctorService doctorService;
	@RequestMapping(value="/select",method=RequestMethod.POST)
	public @ResponseBody Doctor doctorselect(int id){
		Doctor doctor = doctorService.doctorselect(id);
		return doctor;
	}
	@RequestMapping(value="/insert",method=RequestMethod.POST)
	public @ResponseBody String insertdoctor(Doctor doctor){
		doctorService.insertdoctor(doctor);
		return "成功";
	}
	
	@RequestMapping(value="/update",method=RequestMethod.POST)
	public @ResponseBody String updatedoctor(Doctor doctor){
		doctorService.updatedoctor(doctor);
		return "成功";
	}
	@RequestMapping(value="/del",method=RequestMethod.POST)
	public @ResponseBody String deldoctor(int id){
		doctorService.deldoctor(id);
		return "成功";
	}
}
